package com.depthsdata.coe.api;

import com.depthsdata.coe.dao.BusinessNodeFormDAOQueryBean;
import com.depthsdata.coe.service.BusinessNodeFormBean;
import com.ourteam.frame.web.AbstractSearchModel;

public class BusinessNodeFormSearchBean extends AbstractSearchModel<BusinessNodeFormDAOQueryBean> {

	private Long businessNodeId;
	
	public Long getBusinessNodeId() {
		return businessNodeId;
	}

	public void setBusinessNodeId(Long businessNodeId) {
		this.businessNodeId = businessNodeId;
	}

	@Override
	public String getMappedDAOField(String aProperty) {
		return BusinessNodeFormBean.getMappedDAOField(aProperty);
	}

	@Override
	protected void doBuildQueryBean(BusinessNodeFormDAOQueryBean queryBean) throws Exception {
		
		BusinessNodeFormDAOQueryBean.Criteria criteria = queryBean.createCriteria();
		
		if(businessNodeId != null && businessNodeId.longValue() != 0) {
			criteria.andBusinessNodeIdEqualTo(businessNodeId);
		}

	}

}
